package com.muk.meis.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.muk.webframework.framework.log.LoggerFile;

/**
 * Servlet implementation class MEISServlet
 */
@WebServlet("/MEISServlet")
public class MEISServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MEISServlet() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		LoggerFile.log("********** Request meis");
		HttpSession session = request.getSession();
		String userName = (String) session.getAttribute("user_name");
		if(userName != null) {
			response.sendRedirect("landingpage.jsp");
		} else {
		    response.sendRedirect("index.jsp");
		}
	}

}
